#List comprehension
words = "If there is hope it lies in the proles".split()

words

[len(word) for word in words] 


#Equivalent of
lengths = []

for word in words:
    lengths.append(len(word))

lengths


#Elements of a list comprehension
from math import factorial

f = [len(str(factorial(x))) for x in range(20)]

f

type(f)
